package cn.eleven.service.impl;

import cn.eleven.entity.Chat;
import cn.eleven.mapper.ChatMapper;
import cn.eleven.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChatServiceImpl implements ChatService {

    @Autowired
    private ChatMapper chatMapper;

    @Override
    public boolean sendChatMessage(Chat chat) {
        return chatMapper.insert(chat) > 0;
    }

    @Override
    public List<Chat> getChatHistory() {
        return chatMapper.selectList(null);
    }
}